/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jkoa.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "majikan")
@NamedQueries({
    @NamedQuery(name = "Majikan.findAll", query = "SELECT m FROM Majikan m")})
public class Majikan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_majikan")
    private Integer idMajikan;
    @Basic(optional = false)
    @Column(name = "nama_majikan")
    private String namaMajikan;
    @Basic(optional = false)
    @Column(name = "alamat_majikan1")
    private String alamatMajikan1;
    @Column(name = "alamat_majikan2")
    private String alamatMajikan2;
    @Column(name = "alamat_majikan3")
    private String alamatMajikan3;
    @Column(name = "alamat_majikan4")
    private String alamatMajikan4;
    @Basic(optional = false)
    @Column(name = "alamat_daerah")
    private String alamatDaerah;
    @Basic(optional = false)
    @Column(name = "alamat_poskod")
    private String alamatPoskod;
    @Basic(optional = false)
    @ManyToOne
    @JoinColumn(name = "alamat_negeri")    
    private KodNegeri alamatNegeri;
    @Column(name = "bil_pekerja")
    private String bilPekerja;
    @Basic(optional = false)
    @Column(name = "dimasuk")
    private String dimasuk;
    @Basic(optional = false)
    @Column(name = "trh_masuk")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhMasuk;
    @Column(name = "dikkini")
    private String dikkini;
    @Column(name = "trh_kkini")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhKkini;
    //added by : mr5rule
    @ManyToOne
    @JoinColumn(name = "kod_sektor", nullable = false)
    private KodSektor kodSektor;
    @ManyToOne
    @JoinColumn(name = "kod_bidang")
    private KodBidang kodBidang;
    @ManyToOne
    @JoinColumn(name = "kod_subbidang")
    private KodSubbidang kodSubBidang;
    @Column(name = "no_pengenalan")
    private String noPengenalan;
    @Column(name = "no_tel")
    private String noTel;
    @Column(name="no_fax")
    private String noFax;
    @Column(name="email")
    private String email;
    @Column(name="laman_web")
    private String lamanWeb;
    @Column(name="nama_pegawai_dihubungi")
    private String namaPegawaiDihubungi;
    @Column(name="no_tel_pegawai_dihubungi")
    private String noTelPegawaiDihubungi;


    @OneToMany(mappedBy = "idMajikan", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    private List<Peribadi> senaraiPekerja;
    
      @OneToMany(mappedBy = "majikan", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    private List<Latihan> senaraiLatihan;

    public Majikan() {
    }

    public Majikan(Integer idMajikan) {
        this.idMajikan = idMajikan;
    }

    public Majikan(int idMajikan, String namaMajikan, String alamatMajikan1, String alamatDaerah, String alamatPoskod, KodNegeri alamatNegeri, String dimasuk, Date trhMasuk) {
        this.idMajikan = idMajikan;
        this.namaMajikan = namaMajikan;
        this.alamatMajikan1 = alamatMajikan1;
        this.alamatDaerah = alamatDaerah;
        this.alamatPoskod = alamatPoskod;
        this.alamatNegeri = alamatNegeri;
        this.dimasuk = dimasuk;
        this.trhMasuk = trhMasuk;
    }

    public Integer getIdMajikan() {
        return idMajikan;
    }

    public void setIdMajikan(Integer idMajikan) {
        this.idMajikan = idMajikan;
    }

    public String getNamaMajikan() {
        return namaMajikan;
    }

    public void setNamaMajikan(String namaMajikan) {
        this.namaMajikan = namaMajikan;
    }

    public String getAlamatMajikan1() {
        return alamatMajikan1;
    }

    public void setAlamatMajikan1(String alamatMajikan1) {
        this.alamatMajikan1 = alamatMajikan1;
    }

    public String getAlamatMajikan2() {
        return alamatMajikan2;
    }

    public void setAlamatMajikan2(String alamatMajikan2) {
        this.alamatMajikan2 = alamatMajikan2;
    }

    public String getAlamatMajikan3() {
        return alamatMajikan3;
    }

    public void setAlamatMajikan3(String alamatMajikan3) {
        this.alamatMajikan3 = alamatMajikan3;
    }

    public String getAlamatMajikan4() {
        return alamatMajikan4;
    }

    public void setAlamatMajikan4(String alamatMajikan4) {
        this.alamatMajikan4 = alamatMajikan4;
    }

    public String getAlamatDaerah() {
        return alamatDaerah;
    }

    public void setAlamatDaerah(String alamatDaerah) {
        this.alamatDaerah = alamatDaerah;
    }

    public String getAlamatPoskod() {
        return alamatPoskod;
    }

    public void setAlamatPoskod(String alamatPoskod) {
        this.alamatPoskod = alamatPoskod;
    }

    public KodNegeri getAlamatNegeri() {
        return alamatNegeri;
    }

    public void setAlamatNegeri(KodNegeri alamatNegeri) {
        this.alamatNegeri = alamatNegeri;
    }

    public String getBilPekerja() {
        return bilPekerja;
    }

    public void setBilPekerja(String bilPekerja) {
        this.bilPekerja = bilPekerja;
    }

    public String getDimasuk() {
        return dimasuk;
    }

    public void setDimasuk(String dimasuk) {
        this.dimasuk = dimasuk;
    }

    public Date getTrhMasuk() {
        return trhMasuk;
    }

    public void setTrhMasuk(Date trhMasuk) {
        this.trhMasuk = trhMasuk;
    }

    public String getDikkini() {
        return dikkini;
    }

    public void setDikkini(String dikkini) {
        this.dikkini = dikkini;
    }

    public Date getTrhKkini() {
        return trhKkini;
    }

    public void setTrhKkini(Date trhKkini) {
        this.trhKkini = trhKkini;
    }

    public List<Latihan> getSenaraiLatihan() {
        return senaraiLatihan;
    }

    public void setSenaraiLatihan(List<Latihan> senaraiLatihan) {
        this.senaraiLatihan = senaraiLatihan;
    }
       

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMajikan != null ? idMajikan.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Majikan)) {
            return false;
        }
        Majikan other = (Majikan) object;
        if ((this.idMajikan == null && other.idMajikan != null) || (this.idMajikan != null && !this.idMajikan.equals(other.idMajikan))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jkoa.model.Majikan[ idMajikan=" + idMajikan + " ]";
    }
    
    public List<Peribadi> getSenaraiPekerja() {
        return senaraiPekerja;
}

    public void setSenaraiPekerja(List<Peribadi> senaraiPekerja) {
        this.senaraiPekerja = senaraiPekerja;
    }

    public KodBidang getKodBidang() {
        return kodBidang;
    }

    public void setKodBidang(KodBidang kodBidang) {
        this.kodBidang = kodBidang;
    }

    public KodSektor getKodSektor() {
        return kodSektor;
    }

    public void setKodSektor(KodSektor kodSektor) {
        this.kodSektor = kodSektor;
    }

    public KodSubbidang getKodSubBidang() {
        return kodSubBidang;
    }

    public void setKodSubBidang(KodSubbidang kodSubBidang) {
        this.kodSubBidang = kodSubBidang;
    }

    public String getNoPengenalan() {
        return noPengenalan;
    }

    public void setNoPengenalan(String noPengenalan) {
        this.noPengenalan = noPengenalan;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getLamanWeb() {
        return lamanWeb;
    }

    public void setLamanWeb(String lamanWeb) {
        this.lamanWeb = lamanWeb;
    }

    public String getNamaPegawaiDihubungi() {
        return namaPegawaiDihubungi;
    }

    public void setNamaPegawaiDihubungi(String namaPegawaiDihubungi) {
        this.namaPegawaiDihubungi = namaPegawaiDihubungi;
    }

    public String getNoFax() {
        return noFax;
    }

    public void setNoFax(String noFax) {
        this.noFax = noFax;
    }

    public String getNoTel() {
        return noTel;
    }

    public void setNoTel(String noTel) {
        this.noTel = noTel;
    }

    public String getNoTelPegawaiDihubungi() {
        return noTelPegawaiDihubungi;
    }

    public void setNoTelPegawaiDihubungi(String noTelPegawaiDihubungi) {
        this.noTelPegawaiDihubungi = noTelPegawaiDihubungi;
    }

    


    
}
